package kusterordonio.interfaz;

import kusterordonio.dominio.*;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.util.*;
import java.text.*;
import kusterordonio.dominio.*;

public class VentanaParto extends javax.swing.JFrame {

    private SistemaCarne modelo;
    private Ninio niño;
    private boolean caso;
    
    /** Creates new form VentanaParto */
    public VentanaParto() {
        initComponents();
    }
    
    public VentanaParto(SistemaCarne unSistema, Ninio unNiño, boolean unCaso) {
        modelo = unSistema;
        niño = unNiño;
        caso = unCaso;
        initComponents();
        cargarDatos();
        controlGenero();
        controlCaso();
        jLabelCambio.setVisible(false);
        jLabelErrores.setVisible(false);
        jBtnSalir.setMnemonic(KeyEvent.VK_S);
        jBtnConfirmar.setMnemonic(KeyEvent.VK_C);
        jDateEgreso.setMaxSelectableDate(Calendar.getInstance().getTime());
        jDateEgreso.setMinSelectableDate(niño.getFechaNac());
    }
    
    //setea los elementos de la ventana según el rol del actor
    public void controlCaso(){
        jTextAnomalias.setEditable(caso);
        jTextOtras.setEditable(caso);
        jTextPatologias.setEditable(caso);
        jTxtApgar1.setEditable(caso);
        jTxtApgar5.setEditable(caso);
        jTxtPeso.setEditable(caso);
        jTxtTalla.setEditable(caso);
        jTxtPerim.setEditable(caso);
        jTxtGest.setEditable(caso);
        jTxtTsh.setEditable(caso);
        jTxtFenil.setEditable(caso);
        jTxtOhp.setEditable(caso);
        jTxtPesoEgreso.setEditable(caso);
        jComboGrupo.setEnabled(caso);
        jDateEgreso.setEnabled(caso);
        jBtnConfirmar.setVisible(caso);
    }
     
    public void controlGenero(){
         if (!niño.isSexo()){
             jLabelTitulo.setText("Recién nacida");
             jLabelTitulo.setForeground(new java.awt.Color(255, 153, 0));
             jLabelTitular.setForeground(new java.awt.Color(255, 153, 0));
             jLabelAlim.setForeground(new java.awt.Color(255, 153, 0));
             jLabelPesquisa.setForeground(new java.awt.Color(255, 153, 0));
         }
    }
     
    public void cargarDatos(){
        jLabelNombre.setText(niño.toString());
        if(niño.getCarne().getRecienNacido().getPeso() != 0){
            this.jLabelPeso.setText(Integer.toString(niño.getCarne().getRecienNacido().getPeso()));
            this.jTxtPeso.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getTalla() != 0){
            this.jLabelTalla.setText(Integer.toString(niño.getCarne().getRecienNacido().getTalla()));
            this.jTxtTalla.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getPerimCefalico() != 0){
            this.jLabelPerim.setText(Integer.toString(niño.getCarne().getRecienNacido().getPerimCefalico()));
            this.jTxtPerim.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getEdadGest() != 0){
            this.jLabelGest.setText(Integer.toString(niño.getCarne().getRecienNacido().getEdadGest()));
            this.jTxtGest.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getApgar1() != 0){
            this.jLabelApgar1.setText(Integer.toString(niño.getCarne().getRecienNacido().getApgar1()));
            this.jTxtApgar1.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getApgar5() != 0){
            this.jLabelApgar5.setText(Integer.toString(niño.getCarne().getRecienNacido().getApgar5()));
            this.jTxtApgar5.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().isReanimacionNeg()){
           this.jRadioReanimaNo.setSelected(true);
           this.jRadioReanimaNo.setEnabled(false);
           this.jRadioReanimaSi.setEnabled(false);
        }
        if( niño.getCarne().getRecienNacido().isReanimacionPos()){
           this.jRadioReanimaSi.setSelected(true);
           this.jRadioReanimaNo.setEnabled(false);
           this.jRadioReanimaSi.setEnabled(false);
        }
        if(!niño.getCarne().getRecienNacido().getGrupo().equals(" ")){
            this.jLabelCombo.setText(niño.getCarne().getRecienNacido().getGrupo());
            this.jComboGrupo.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().isRhMenos()){
           this.jRadioRhMenos.setSelected(true);
           this.jRadioRhMenos.setEnabled(false);
           this.jRadioRhMas.setEnabled(false);
        }
        if( niño.getCarne().getRecienNacido().isRhMas()){
           this.jRadioRhMas.setSelected(true);
           this.jRadioRhMenos.setEnabled(false);
           this.jRadioRhMas.setEnabled(false);
        }
        if(niño.getCarne().getRecienNacido().isCoombsNeg()){
           this.jRadioCoombsMenos.setSelected(true);
           this.jRadioCoombsMenos.setEnabled(false);
           this.jRadioCoombsMas.setEnabled(false);
        }
        if( niño.getCarne().getRecienNacido().isCoombsPos()){
           this.jRadioCoombsMas.setSelected(true);
            this.jRadioCoombsMenos.setEnabled(false);
           this.jRadioCoombsMas.setEnabled(false);
        }
        if(niño.getCarne().getRecienNacido().isVdrlNeg()){
           this.jRadioVdrlMenos.setSelected(true);
           this.jRadioVdrlMenos.setEnabled(false);
           this.jRadioVdrlMas.setEnabled(false);
        }
        if( niño.getCarne().getRecienNacido().isVdrlPos()){
           this.jRadioVdrlMas.setSelected(true);
            this.jRadioVdrlMenos.setEnabled(false);
           this.jRadioVdrlMas.setEnabled(false);
        }
        if(niño.getCarne().getRecienNacido().getTsh() != 0){
            this.jLabelTsh.setText(Double.toString(niño.getCarne().getRecienNacido().getTsh()));
            this.jTxtTsh.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getFenilalanina() != 0){
            this.jLabelFenil.setText(Double.toString(niño.getCarne().getRecienNacido().getFenilalanina()));
            this.jTxtFenil.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getOhp17() != 0){
            this.jLabelOhp.setText(Integer.toString(niño.getCarne().getRecienNacido().getOhp17()));
            this.jTxtOhp.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().isAuditivoNeg()){
           this.jRadioAuditivoNo.setSelected(true);
           this.jRadioAuditivoNo.setEnabled(false);
           this.jRadioAuditivoSi.setEnabled(false);
        }
        if(niño.getCarne().getRecienNacido().isAuditivoPos()){
           this.jRadioAuditivoSi.setSelected(true);
           this.jRadioAuditivoNo.setEnabled(false);
           this.jRadioAuditivoSi.setEnabled(false);
        }
        if(!niño.getCarne().getRecienNacido().getOtras().equals("")){
            this.jLabelOtras.setText(niño.getCarne().getRecienNacido().getOtras());
            this.jTextOtras.setVisible(false);
        }
        if(!niño.getCarne().getRecienNacido().getAnomalias().equals("")){
            this.jLabelAnomalias.setText(niño.getCarne().getRecienNacido().getAnomalias());
            this.jTextAnomalias.setVisible(false);
        }
        if(!niño.getCarne().getRecienNacido().getPatologia().equals("")){
            this.jLabelPatologia.setText(niño.getCarne().getRecienNacido().getPatologia());
            this.jTextPatologias.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().getPesoEgreso() != 0){
            this.jLabelPesoEgreso.setText(Integer.toString(niño.getCarne().getRecienNacido().getPesoEgreso()));
            this.jTxtPesoEgreso.setVisible(false);
        }
        if(niño.getCarne().getRecienNacido().isLactanciaExc()){
           this.jRadioLactancia.setSelected(true);
           this.jRadioLactancia.setEnabled(false);
           this.jRadioArtificial.setEnabled(false);
           this.jRadioMixta.setEnabled(false);
        }
        if( niño.getCarne().getRecienNacido().isArtificial()){
           this.jRadioArtificial.setSelected(true);
           this.jRadioLactancia.setEnabled(false);
           this.jRadioArtificial.setEnabled(false);
           this.jRadioMixta.setEnabled(false);
        }
        if( niño.getCarne().getRecienNacido().isMixta()){
           this.jRadioMixta.setSelected(true);
           this.jRadioLactancia.setEnabled(false);
           this.jRadioArtificial.setEnabled(false);
           this.jRadioMixta.setEnabled(false);
        }
        
        if(niño.getCarne().getRecienNacido().getFechaEgreso()!= null){   
            this.jDateEgreso.setDate(niño.getCarne().getRecienNacido().getFechaEgreso());
            this.jDateEgreso.setEnabled(false);
            this.jDateEgreso.setVisible(false);
            SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");
            this.jLabelFechaEgreso.setText(formato.format(niño.getCarne().getRecienNacido().getFechaEgreso()));
        }
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        buttonGroup5 = new javax.swing.ButtonGroup();
        buttonGroup6 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabelTitulo = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel2 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabelPesquisa = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabelAlim = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jTxtPeso = new javax.swing.JTextField();
        jTxtTalla = new javax.swing.JTextField();
        jTxtPerim = new javax.swing.JTextField();
        jTxtGest = new javax.swing.JTextField();
        jTxtApgar1 = new javax.swing.JTextField();
        jTxtApgar5 = new javax.swing.JTextField();
        jTxtTsh = new javax.swing.JTextField();
        jTxtFenil = new javax.swing.JTextField();
        jTxtOhp = new javax.swing.JTextField();
        jTextOtras = new javax.swing.JTextField();
        jTextAnomalias = new javax.swing.JTextField();
        jTextPatologias = new javax.swing.JTextField();
        jTxtPesoEgreso = new javax.swing.JTextField();
        jDateEgreso = new com.toedter.calendar.JDateChooser();
        jLabelPeso = new javax.swing.JLabel();
        jLabelTalla = new javax.swing.JLabel();
        jLabelPerim = new javax.swing.JLabel();
        jBtnConfirmar = new javax.swing.JButton();
        jBtnSalir = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JSeparator();
        jSeparator4 = new javax.swing.JSeparator();
        jLabelGest = new javax.swing.JLabel();
        jLabelApgar1 = new javax.swing.JLabel();
        jLabelApgar5 = new javax.swing.JLabel();
        jRadioReanimaNo = new javax.swing.JRadioButton();
        jRadioReanimaSi = new javax.swing.JRadioButton();
        jComboGrupo = new javax.swing.JComboBox();
        jLabelCombo = new javax.swing.JLabel();
        jRadioRhMenos = new javax.swing.JRadioButton();
        jRadioRhMas = new javax.swing.JRadioButton();
        jRadioCoombsMenos = new javax.swing.JRadioButton();
        jRadioCoombsMas = new javax.swing.JRadioButton();
        jRadioVdrlMenos = new javax.swing.JRadioButton();
        jRadioVdrlMas = new javax.swing.JRadioButton();
        jLabelTsh = new javax.swing.JLabel();
        jLabelFenil = new javax.swing.JLabel();
        jLabelOhp = new javax.swing.JLabel();
        jRadioAuditivoNo = new javax.swing.JRadioButton();
        jRadioAuditivoSi = new javax.swing.JRadioButton();
        jSeparator2 = new javax.swing.JSeparator();
        jLabelOtras = new javax.swing.JLabel();
        jLabelAnomalias = new javax.swing.JLabel();
        jLabelPatologia = new javax.swing.JLabel();
        jLabelPesoEgreso = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jRadioLactancia = new javax.swing.JRadioButton();
        jRadioArtificial = new javax.swing.JRadioButton();
        jRadioMixta = new javax.swing.JRadioButton();
        jLabelFechaEgreso = new javax.swing.JLabel();
        jLabelCambio = new javax.swing.JLabel();
        jLabelErrores = new javax.swing.JLabel();
        jLabelFecha = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabelTitular = new javax.swing.JLabel();
        jLabelNombre = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Recién nacido");
        setBounds(new java.awt.Rectangle(200, 100, 0, 0));
        setResizable(false);

        jPanel1.setLayout(null);

        jLabelTitulo.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabelTitulo.setForeground(new java.awt.Color(51, 153, 0));
        jLabelTitulo.setText("Recién nacido");
        jPanel1.add(jLabelTitulo);
        jLabelTitulo.setBounds(20, 20, 140, 20);
        jPanel1.add(jSeparator1);
        jSeparator1.setBounds(0, 52, 640, 10);

        jLabel2.setText("Peso");
        jPanel1.add(jLabel2);
        jLabel2.setBounds(40, 80, 40, 20);

        jLabel35.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel35.setText("gr.");
        jPanel1.add(jLabel35);
        jLabel35.setBounds(160, 80, 20, 20);

        jLabel3.setText("Talla");
        jPanel1.add(jLabel3);
        jLabel3.setBounds(250, 80, 40, 20);

        jLabel36.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel36.setText("cm.");
        jPanel1.add(jLabel36);
        jLabel36.setBounds(340, 80, 20, 20);

        jLabel4.setText("Perímetro cefálico");
        jPanel1.add(jLabel4);
        jLabel4.setBounds(400, 80, 120, 20);

        jLabel37.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel37.setText("cm.");
        jPanel1.add(jLabel37);
        jLabel37.setBounds(600, 80, 20, 20);

        jLabel5.setText("Edad gestacional");
        jPanel1.add(jLabel5);
        jLabel5.setBounds(40, 120, 100, 20);

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel6.setText("semanas");
        jPanel1.add(jLabel6);
        jLabel6.setBounds(200, 120, 40, 20);

        jLabel7.setText("Apgar");
        jPanel1.add(jLabel7);
        jLabel7.setBounds(270, 120, 50, 20);

        jLabel8.setText("1º");
        jPanel1.add(jLabel8);
        jLabel8.setBounds(320, 120, 20, 20);

        jLabel9.setText("5º");
        jPanel1.add(jLabel9);
        jLabel9.setBounds(370, 120, 20, 20);

        jLabel10.setText("Reanimación");
        jPanel1.add(jLabel10);
        jLabel10.setBounds(440, 120, 90, 20);

        jLabel11.setText("Grupo sanguíneo");
        jPanel1.add(jLabel11);
        jLabel11.setBounds(40, 170, 110, 20);

        jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel12.setText("RH");
        jPanel1.add(jLabel12);
        jLabel12.setBounds(200, 170, 30, 20);

        jLabel38.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel38.setText("+");
        jPanel1.add(jLabel38);
        jLabel38.setBounds(270, 170, 20, 20);

        jLabel39.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel39.setText("-");
        jPanel1.add(jLabel39);
        jLabel39.setBounds(230, 170, 20, 20);

        jLabel13.setText("Coombs");
        jPanel1.add(jLabel13);
        jLabel13.setBounds(340, 170, 50, 20);

        jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel14.setText("+");
        jPanel1.add(jLabel14);
        jLabel14.setBounds(430, 170, 20, 20);

        jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel15.setText("-");
        jPanel1.add(jLabel15);
        jLabel15.setBounds(390, 170, 20, 20);

        jLabel16.setText("VDRL");
        jPanel1.add(jLabel16);
        jLabel16.setBounds(500, 170, 40, 20);

        jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel17.setText("+");
        jPanel1.add(jLabel17);
        jLabel17.setBounds(580, 170, 20, 20);

        jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel18.setText("-");
        jPanel1.add(jLabel18);
        jLabel18.setBounds(540, 170, 20, 20);

        jLabelPesquisa.setFont(new java.awt.Font("Tahoma", 1, 13));
        jLabelPesquisa.setForeground(new java.awt.Color(51, 153, 0));
        jLabelPesquisa.setText("Pesquisa neonatal");
        jPanel1.add(jLabelPesquisa);
        jLabelPesquisa.setBounds(30, 210, 130, 20);

        jLabel20.setText("TSH");
        jPanel1.add(jLabel20);
        jLabel20.setBounds(40, 250, 30, 20);

        jLabel21.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel21.setText("mUL/L");
        jPanel1.add(jLabel21);
        jLabel21.setBounds(150, 250, 40, 20);

        jLabel22.setText("Fenilalanina");
        jPanel1.add(jLabel22);
        jLabel22.setBounds(200, 250, 80, 20);

        jLabel23.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel23.setText("mg/dL");
        jPanel1.add(jLabel23);
        jLabel23.setBounds(370, 250, 40, 20);

        jLabel24.setText("17-OHP");
        jPanel1.add(jLabel24);
        jLabel24.setBounds(430, 250, 50, 20);

        jLabel25.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel25.setText("ng/dL");
        jPanel1.add(jLabel25);
        jLabel25.setBounds(560, 250, 40, 20);

        jLabel26.setText("Auditivo");
        jPanel1.add(jLabel26);
        jLabel26.setBounds(40, 290, 60, 20);

        jLabel40.setText("Otras");
        jPanel1.add(jLabel40);
        jLabel40.setBounds(230, 290, 50, 20);

        jLabel27.setText("Anomalías y malformaciones");
        jPanel1.add(jLabel27);
        jLabel27.setBounds(40, 330, 180, 20);

        jLabel28.setText("Peso Egreso");
        jPanel1.add(jLabel28);
        jLabel28.setBounds(410, 380, 90, 20);

        jLabel29.setFont(new java.awt.Font("Tahoma", 0, 9));
        jLabel29.setText("gr.");
        jPanel1.add(jLabel29);
        jLabel29.setBounds(580, 380, 20, 20);

        jLabel30.setText("Patología");
        jPanel1.add(jLabel30);
        jLabel30.setBounds(40, 380, 80, 20);

        jLabelAlim.setFont(new java.awt.Font("Tahoma", 1, 13));
        jLabelAlim.setForeground(new java.awt.Color(51, 153, 0));
        jLabelAlim.setText("Alimentación al alta");
        jPanel1.add(jLabelAlim);
        jLabelAlim.setBounds(20, 420, 140, 20);

        jLabel32.setText("Lactancia");
        jPanel1.add(jLabel32);
        jLabel32.setBounds(80, 457, 70, 15);

        jLabel33.setText("Fecha egreso");
        jPanel1.add(jLabel33);
        jLabel33.setBounds(430, 460, 90, 20);

        jLabel34.setText("Mixta");
        jPanel1.add(jLabel34);
        jLabel34.setBounds(290, 460, 40, 20);

        jLabel41.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel41.setText("No");
        jPanel1.add(jLabel41);
        jLabel41.setBounds(90, 290, 20, 20);

        jLabel42.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel42.setText("Si");
        jPanel1.add(jLabel42);
        jLabel42.setBounds(140, 290, 20, 20);

        jLabel43.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel43.setText("No");
        jPanel1.add(jLabel43);
        jLabel43.setBounds(530, 120, 20, 20);

        jLabel44.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel44.setText("Si");
        jPanel1.add(jLabel44);
        jLabel44.setBounds(580, 120, 20, 20);

        jTxtPeso.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtPeso.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtPesoFocusGained(evt);
            }
        });
        jPanel1.add(jTxtPeso);
        jTxtPeso.setBounds(80, 80, 70, 20);

        jTxtTalla.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtTalla.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtTallaFocusGained(evt);
            }
        });
        jPanel1.add(jTxtTalla);
        jTxtTalla.setBounds(290, 80, 40, 20);

        jTxtPerim.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtPerim.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtPerimFocusGained(evt);
            }
        });
        jPanel1.add(jTxtPerim);
        jTxtPerim.setBounds(520, 80, 70, 20);

        jTxtGest.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtGest.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtGestFocusGained(evt);
            }
        });
        jPanel1.add(jTxtGest);
        jTxtGest.setBounds(150, 120, 40, 20);

        jTxtApgar1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtApgar1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtApgar1FocusGained(evt);
            }
        });
        jPanel1.add(jTxtApgar1);
        jTxtApgar1.setBounds(340, 120, 20, 20);

        jTxtApgar5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtApgar5.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtApgar5FocusGained(evt);
            }
        });
        jPanel1.add(jTxtApgar5);
        jTxtApgar5.setBounds(390, 120, 20, 20);

        jTxtTsh.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtTsh.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtTshFocusGained(evt);
            }
        });
        jPanel1.add(jTxtTsh);
        jTxtTsh.setBounds(70, 250, 70, 20);

        jTxtFenil.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtFenil.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtFenilFocusGained(evt);
            }
        });
        jPanel1.add(jTxtFenil);
        jTxtFenil.setBounds(280, 250, 70, 20);

        jTxtOhp.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtOhp.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtOhpFocusGained(evt);
            }
        });
        jPanel1.add(jTxtOhp);
        jTxtOhp.setBounds(480, 250, 70, 20);

        jTextOtras.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jPanel1.add(jTextOtras);
        jTextOtras.setBounds(280, 290, 330, 20);

        jTextAnomalias.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jPanel1.add(jTextAnomalias);
        jTextAnomalias.setBounds(220, 330, 330, 20);

        jTextPatologias.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jPanel1.add(jTextPatologias);
        jTextPatologias.setBounds(120, 380, 260, 20);

        jTxtPesoEgreso.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, new java.awt.Color(255, 255, 0), null, new java.awt.Color(204, 204, 0)));
        jTxtPesoEgreso.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTxtPesoEgresoFocusGained(evt);
            }
        });
        jPanel1.add(jTxtPesoEgreso);
        jTxtPesoEgreso.setBounds(500, 380, 70, 20);

        jDateEgreso.setDateFormatString("dd/MM/yyyy");
        jPanel1.add(jDateEgreso);
        jDateEgreso.setBounds(520, 460, 90, 20);

        jLabelPeso.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelPeso.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelPeso);
        jLabelPeso.setBounds(80, 80, 70, 20);

        jLabelTalla.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTalla.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelTalla);
        jLabelTalla.setBounds(290, 80, 40, 20);

        jLabelPerim.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelPerim.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelPerim);
        jLabelPerim.setBounds(520, 80, 70, 20);

        jBtnConfirmar.setText("Confirmar datos");
        jBtnConfirmar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jBtnConfirmarMouseExited(evt);
            }
        });
        jBtnConfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnConfirmarActionPerformed(evt);
            }
        });
        jPanel1.add(jBtnConfirmar);
        jBtnConfirmar.setBounds(150, 530, 130, 22);

        jBtnSalir.setText("Salir");
        jBtnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnSalirActionPerformed(evt);
            }
        });
        jPanel1.add(jBtnSalir);
        jBtnSalir.setBounds(370, 530, 130, 22);
        jPanel1.add(jSeparator3);
        jSeparator3.setBounds(0, 500, 640, 10);
        jPanel1.add(jSeparator4);
        jSeparator4.setBounds(10, 410, 610, 10);

        jLabelGest.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelGest.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelGest);
        jLabelGest.setBounds(150, 120, 40, 20);

        jLabelApgar1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelApgar1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelApgar1);
        jLabelApgar1.setBounds(340, 120, 20, 20);

        jLabelApgar5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelApgar5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelApgar5);
        jLabelApgar5.setBounds(390, 120, 20, 20);

        jRadioReanimaNo.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup1.add(jRadioReanimaNo);
        jPanel1.add(jRadioReanimaNo);
        jRadioReanimaNo.setBounds(550, 120, 20, 20);

        jRadioReanimaSi.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup1.add(jRadioReanimaSi);
        jPanel1.add(jRadioReanimaSi);
        jRadioReanimaSi.setBounds(600, 120, 20, 20);

        jComboGrupo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " ", "O", "A", "B", "AB" }));
        jPanel1.add(jComboGrupo);
        jComboGrupo.setBounds(140, 170, 50, 20);

        jLabelCombo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelCombo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelCombo);
        jLabelCombo.setBounds(150, 170, 40, 20);

        jRadioRhMenos.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup2.add(jRadioRhMenos);
        jPanel1.add(jRadioRhMenos);
        jRadioRhMenos.setBounds(250, 170, 20, 20);

        jRadioRhMas.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup2.add(jRadioRhMas);
        jPanel1.add(jRadioRhMas);
        jRadioRhMas.setBounds(290, 170, 20, 20);

        jRadioCoombsMenos.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup3.add(jRadioCoombsMenos);
        jPanel1.add(jRadioCoombsMenos);
        jRadioCoombsMenos.setBounds(410, 170, 20, 20);

        jRadioCoombsMas.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup3.add(jRadioCoombsMas);
        jPanel1.add(jRadioCoombsMas);
        jRadioCoombsMas.setBounds(450, 170, 20, 20);

        jRadioVdrlMenos.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup4.add(jRadioVdrlMenos);
        jPanel1.add(jRadioVdrlMenos);
        jRadioVdrlMenos.setBounds(560, 170, 20, 20);

        jRadioVdrlMas.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup4.add(jRadioVdrlMas);
        jPanel1.add(jRadioVdrlMas);
        jRadioVdrlMas.setBounds(600, 170, 20, 20);

        jLabelTsh.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTsh.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelTsh);
        jLabelTsh.setBounds(70, 250, 70, 20);

        jLabelFenil.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelFenil.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelFenil);
        jLabelFenil.setBounds(280, 250, 70, 20);

        jLabelOhp.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelOhp.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelOhp);
        jLabelOhp.setBounds(480, 250, 70, 20);

        jRadioAuditivoNo.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup5.add(jRadioAuditivoNo);
        jPanel1.add(jRadioAuditivoNo);
        jRadioAuditivoNo.setBounds(110, 290, 21, 21);

        jRadioAuditivoSi.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup5.add(jRadioAuditivoSi);
        jPanel1.add(jRadioAuditivoSi);
        jRadioAuditivoSi.setBounds(160, 290, 21, 21);
        jPanel1.add(jSeparator2);
        jSeparator2.setBounds(10, 200, 610, 2);

        jLabelOtras.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelOtras);
        jLabelOtras.setBounds(280, 290, 330, 20);

        jLabelAnomalias.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelAnomalias);
        jLabelAnomalias.setBounds(220, 330, 330, 20);

        jLabelPatologia.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelPatologia);
        jLabelPatologia.setBounds(120, 380, 260, 20);

        jLabelPesoEgreso.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelPesoEgreso.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelPesoEgreso);
        jLabelPesoEgreso.setBounds(500, 380, 70, 20);

        jLabel45.setText("Artificial");
        jPanel1.add(jLabel45);
        jLabel45.setBounds(190, 460, 60, 20);

        jRadioLactancia.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup6.add(jRadioLactancia);
        jPanel1.add(jRadioLactancia);
        jRadioLactancia.setBounds(140, 460, 20, 20);

        jRadioArtificial.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup6.add(jRadioArtificial);
        jPanel1.add(jRadioArtificial);
        jRadioArtificial.setBounds(240, 460, 20, 20);

        jRadioMixta.setBackground(new java.awt.Color(255, 255, 0));
        buttonGroup6.add(jRadioMixta);
        jPanel1.add(jRadioMixta);
        jRadioMixta.setBounds(330, 460, 20, 20);

        jLabelFechaEgreso.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelFechaEgreso.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(jLabelFechaEgreso);
        jLabelFechaEgreso.setBounds(520, 460, 90, 20);

        jLabelCambio.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelCambio.setText("El cambio se ha realizado");
        jPanel1.add(jLabelCambio);
        jLabelCambio.setBounds(145, 510, 150, 14);

        jLabelErrores.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelErrores.setForeground(new java.awt.Color(255, 0, 0));
        jLabelErrores.setText("No se han guardado los datos marcados en rojo");
        jPanel1.add(jLabelErrores);
        jLabelErrores.setBounds(80, 510, 300, 14);

        jLabelFecha.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabelFecha.setForeground(new java.awt.Color(255, 0, 0));
        jLabelFecha.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelFechaMouseEntered(evt);
            }
        });
        jPanel1.add(jLabelFecha);
        jLabelFecha.setBounds(510, 450, 120, 40);

        jLabel1.setText("exclusiva");
        jPanel1.add(jLabel1);
        jLabel1.setBounds(80, 470, 50, 14);

        jLabelTitular.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelTitular.setForeground(new java.awt.Color(51, 153, 0));
        jLabelTitular.setText("Titular:");
        jPanel1.add(jLabelTitular);
        jLabelTitular.setBounds(350, 25, 50, 20);

        jLabelNombre.setFont(new java.awt.Font("Tahoma", 1, 14));
        jPanel1.add(jLabelNombre);
        jLabelNombre.setBounds(410, 25, 220, 20);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 634, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 564, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
private void jBtnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnSalirActionPerformed
    this.dispose();
}//GEN-LAST:event_jBtnSalirActionPerformed

private void jBtnConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnConfirmarActionPerformed
    if(jTxtPeso.isEnabled() && !jTxtPeso.getText().equals("")){
        if(modelo.controlEnteroPos(jTxtPeso.getText()) 
                && niño.getCarne().getRecienNacido().controlPeso(Integer.parseInt(jTxtPeso.getText()))){
            niño.getCarne().getRecienNacido().setPeso(Integer.parseInt(jTxtPeso.getText()));
        }else{
           this.jTxtPeso.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jTxtTalla.isEnabled() && !jTxtTalla.getText().equals("")){
        if(modelo.controlEnteroPos(jTxtTalla.getText())
                && niño.getCarne().getRecienNacido().controlTalla(Integer.parseInt(jTxtTalla.getText()))){
            niño.getCarne().getRecienNacido().setTalla(Integer.parseInt(jTxtTalla.getText()));
        }else{
           this.jTxtTalla.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jTxtPerim.isEnabled() && !jTxtPerim.getText().equals("")){
        if(modelo.controlEnteroPos(jTxtPerim.getText())
                && niño.getCarne().getRecienNacido().controlPerimCefalico(Integer.parseInt(jTxtPerim.getText()))){
            niño.getCarne().getRecienNacido().setPerimCefalico(Integer.parseInt(jTxtPerim.getText()));
        }else{
           this.jTxtPerim.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jTxtGest.isEnabled() && !jTxtGest.getText().equals("")){
        if(modelo.controlEnteroPos(jTxtGest.getText())
                && niño.getCarne().getRecienNacido().controlGestacion(Integer.parseInt(jTxtGest.getText()))){
            niño.getCarne().getRecienNacido().setEdadGest(Integer.parseInt(jTxtGest.getText()));
        }else{
           this.jTxtGest.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jTxtApgar1.isEnabled() && !jTxtApgar1.getText().equals("")){
        if(modelo.controlEnteroCero(jTxtApgar1.getText())
                && niño.getCarne().getRecienNacido().controlApgar(Integer.parseInt(jTxtApgar1.getText()))){
            niño.getCarne().getRecienNacido().setApgar1(Integer.parseInt(jTxtApgar1.getText()));
        }else{
           this.jTxtApgar1.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jTxtApgar5.isEnabled() && !jTxtApgar5.getText().equals("")){
        if(modelo.controlEnteroCero(jTxtApgar5.getText())
                && niño.getCarne().getRecienNacido().controlApgar(Integer.parseInt(jTxtApgar5.getText()))){
            niño.getCarne().getRecienNacido().setApgar5(Integer.parseInt(jTxtApgar5.getText()));
        }else{
           this.jTxtApgar5.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jRadioReanimaNo.isEnabled()){
        niño.getCarne().getRecienNacido().setReanimacionNeg(jRadioReanimaNo.isSelected());
    }
    if(jRadioReanimaSi.isEnabled()){
        niño.getCarne().getRecienNacido().setReanimacionPos(jRadioReanimaSi.isSelected());
    }
    if(jComboGrupo.isEnabled()){
        niño.getCarne().getRecienNacido().setGrupo(jComboGrupo.getSelectedItem().toString());
    }
    if(jRadioRhMenos.isEnabled()){
        niño.getCarne().getRecienNacido().setRhMenos(jRadioRhMenos.isSelected());
    }
    if(jRadioRhMas.isEnabled()){
        niño.getCarne().getRecienNacido().setRhMas(jRadioRhMas.isSelected());
    }
    if(jRadioCoombsMenos.isEnabled()){
        niño.getCarne().getRecienNacido().setCoombsNeg(jRadioCoombsMenos.isSelected());
    }
    if(jRadioCoombsMas.isEnabled()){
        niño.getCarne().getRecienNacido().setCoombsPos(jRadioCoombsMas.isSelected());
    }
    if(jRadioVdrlMenos.isEnabled()){
        niño.getCarne().getRecienNacido().setVdrlNeg(jRadioVdrlMenos.isSelected());
    }
    if(jRadioVdrlMas.isEnabled()){
        niño.getCarne().getRecienNacido().setVdrlPos(jRadioVdrlMas.isSelected());
    }
    if(jTxtTsh.isEnabled() && !jTxtTsh.getText().equals("")){
        if(modelo.controlDoublePos(jTxtTsh.getText())
                && niño.getCarne().getRecienNacido().controlTSH(Double.parseDouble(jTxtTsh.getText()))){
            niño.getCarne().getRecienNacido().setTsh(Double.parseDouble(jTxtTsh.getText()));
        }else{
           this.jTxtTsh.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jTxtFenil.isEnabled() && !jTxtFenil.getText().equals("")){
        if(modelo.controlDoublePos(jTxtFenil.getText())
                && niño.getCarne().getRecienNacido().controlFenilalanina(Double.parseDouble(jTxtFenil.getText()))){
            niño.getCarne().getRecienNacido().setFenilalanina(Double.parseDouble(jTxtFenil.getText()));
        }else{
           this.jTxtFenil.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jTxtOhp.isEnabled() && !jTxtOhp.getText().equals("")){
        if(modelo.controlEnteroPos(jTxtOhp.getText())
                && niño.getCarne().getRecienNacido().controlOHP(Integer.parseInt(jTxtOhp.getText()))){
            niño.getCarne().getRecienNacido().setOhp17(Integer.parseInt(jTxtOhp.getText()));
        }else{
           this.jTxtOhp.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jRadioAuditivoNo.isEnabled()){
        niño.getCarne().getRecienNacido().setAuditivoNeg(jRadioAuditivoNo.isSelected());
    }
    if(jRadioAuditivoSi.isEnabled()){
        niño.getCarne().getRecienNacido().setAuditivoPos(jRadioAuditivoSi.isSelected());
    }
    if(jTextOtras.isEnabled() && !jTextOtras.getText().equals("")){
        niño.getCarne().getRecienNacido().setOtras(jTextOtras.getText());
    }
    if(jTextAnomalias.isEnabled() && !jTextAnomalias.getText().equals("")){
        niño.getCarne().getRecienNacido().setAnomalias(jTextAnomalias.getText());
    }
    if(jTextPatologias.isEnabled() && !jTextPatologias.getText().equals("")){
        niño.getCarne().getRecienNacido().setPatologia(jTextPatologias.getText());
    }
    if(jTxtPesoEgreso.isEnabled() && !jTxtPesoEgreso.getText().equals("")){
        if(modelo.controlEnteroPos(jTxtPesoEgreso.getText())
                && niño.getCarne().getRecienNacido().controlPesoEgreso(Integer.parseInt(jTxtPesoEgreso.getText()))){
            niño.getCarne().getRecienNacido().setPesoEgreso(Integer.parseInt(jTxtPesoEgreso.getText()));
        }else{
           this.jTxtPesoEgreso.setBackground(Color.red);
           jLabelErrores.setVisible(true);
       }
    }
    if(jRadioLactancia.isEnabled()){
        niño.getCarne().getRecienNacido().setLactanciaExc(jRadioLactancia.isSelected());
    }
    if(jRadioArtificial.isEnabled()){
        niño.getCarne().getRecienNacido().setArtificial(jRadioArtificial.isSelected());
    }
    if(jRadioMixta.isEnabled()){
        niño.getCarne().getRecienNacido().setMixta(jRadioMixta.isSelected());
    }
    if(jDateEgreso.getDate()!= null && niño.controlFecha(jDateEgreso.getDate())){ 
        niño.getCarne().getRecienNacido().setFechaEgreso(this.jDateEgreso.getDate());    
    }else if (jDateEgreso.getDate()!= null && !niño.controlFecha(jDateEgreso.getDate())){
        jLabelErrores.setVisible(true);
    }
    if(!jLabelErrores.isVisible()){
        jLabelCambio.setVisible(true);
    }
}//GEN-LAST:event_jBtnConfirmarActionPerformed

    private void jBtnConfirmarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jBtnConfirmarMouseExited
        this.jLabelCambio.setVisible(false);
    }//GEN-LAST:event_jBtnConfirmarMouseExited

private void jLabelFechaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelFechaMouseEntered
    this.jLabelErrores.setVisible(false);
}//GEN-LAST:event_jLabelFechaMouseEntered

    private void jTxtPesoEgresoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtPesoEgresoFocusGained
        this.jTxtPesoEgreso.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtPesoEgresoFocusGained

    private void jTxtPesoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtPesoFocusGained
        this.jTxtPeso.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtPesoFocusGained

    private void jTxtTshFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtTshFocusGained
        this.jTxtTsh.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtTshFocusGained

    private void jTxtFenilFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtFenilFocusGained
        this.jTxtFenil.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtFenilFocusGained

    private void jTxtOhpFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtOhpFocusGained
        this.jTxtOhp.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtOhpFocusGained

    private void jTxtTallaFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtTallaFocusGained
        this.jTxtTalla.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtTallaFocusGained

    private void jTxtPerimFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtPerimFocusGained
        jTxtPerim.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtPerimFocusGained

    private void jTxtGestFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtGestFocusGained
        this.jTxtGest.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtGestFocusGained

    private void jTxtApgar1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtApgar1FocusGained
        this.jTxtApgar1.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtApgar1FocusGained

    private void jTxtApgar5FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTxtApgar5FocusGained
        this.jTxtApgar5.setBackground(Color.white);
        this.jLabelErrores.setVisible(false);
    }//GEN-LAST:event_jTxtApgar5FocusGained
  
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.ButtonGroup buttonGroup5;
    private javax.swing.ButtonGroup buttonGroup6;
    private javax.swing.JButton jBtnConfirmar;
    private javax.swing.JButton jBtnSalir;
    private javax.swing.JComboBox jComboGrupo;
    private com.toedter.calendar.JDateChooser jDateEgreso;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelAlim;
    private javax.swing.JLabel jLabelAnomalias;
    private javax.swing.JLabel jLabelApgar1;
    private javax.swing.JLabel jLabelApgar5;
    private javax.swing.JLabel jLabelCambio;
    private javax.swing.JLabel jLabelCombo;
    private javax.swing.JLabel jLabelErrores;
    private javax.swing.JLabel jLabelFecha;
    private javax.swing.JLabel jLabelFechaEgreso;
    private javax.swing.JLabel jLabelFenil;
    private javax.swing.JLabel jLabelGest;
    private javax.swing.JLabel jLabelNombre;
    private javax.swing.JLabel jLabelOhp;
    private javax.swing.JLabel jLabelOtras;
    private javax.swing.JLabel jLabelPatologia;
    private javax.swing.JLabel jLabelPerim;
    private javax.swing.JLabel jLabelPeso;
    private javax.swing.JLabel jLabelPesoEgreso;
    private javax.swing.JLabel jLabelPesquisa;
    private javax.swing.JLabel jLabelTalla;
    private javax.swing.JLabel jLabelTitular;
    private javax.swing.JLabel jLabelTitulo;
    private javax.swing.JLabel jLabelTsh;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JRadioButton jRadioArtificial;
    private javax.swing.JRadioButton jRadioAuditivoNo;
    private javax.swing.JRadioButton jRadioAuditivoSi;
    private javax.swing.JRadioButton jRadioCoombsMas;
    private javax.swing.JRadioButton jRadioCoombsMenos;
    private javax.swing.JRadioButton jRadioLactancia;
    private javax.swing.JRadioButton jRadioMixta;
    private javax.swing.JRadioButton jRadioReanimaNo;
    private javax.swing.JRadioButton jRadioReanimaSi;
    private javax.swing.JRadioButton jRadioRhMas;
    private javax.swing.JRadioButton jRadioRhMenos;
    private javax.swing.JRadioButton jRadioVdrlMas;
    private javax.swing.JRadioButton jRadioVdrlMenos;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JTextField jTextAnomalias;
    private javax.swing.JTextField jTextOtras;
    private javax.swing.JTextField jTextPatologias;
    private javax.swing.JTextField jTxtApgar1;
    private javax.swing.JTextField jTxtApgar5;
    private javax.swing.JTextField jTxtFenil;
    private javax.swing.JTextField jTxtGest;
    private javax.swing.JTextField jTxtOhp;
    private javax.swing.JTextField jTxtPerim;
    private javax.swing.JTextField jTxtPeso;
    private javax.swing.JTextField jTxtPesoEgreso;
    private javax.swing.JTextField jTxtTalla;
    private javax.swing.JTextField jTxtTsh;
    // End of variables declaration//GEN-END:variables
}
